import * as types from '../actionTypes/channel'
// 文章频道
const initialState = {
  list: [],
  activeId: 0
}
const channel = (state = initialState, action) => {
  switch (action.type) {
    // 获取频道
    case types.GET_CHANGELS:
      return {
        ...state,
        list: action.payload
      }
    // 高亮效果
    case types.CHANGE_ACTIVE:
      return {
        ...state,
        activeId: action.payload
      }  
    default:
      return state
  }
}

export default channel